Networking devices, such as network address translation (NAT) devices, firewall devices, etc., maintain state for each connection they serve. As a mechanism to cleanup connection state, the networking devices may time-out when a connection between a client and a server remains inactive for a predetermined period of time, causing the device to terminate service for this connection. To prevent the networking devices from timing out due to inactivity, a fixed keep-alive interval may be used. The fixed keep-alive interval may be shorter than most or all of the known time-out values corresponding to networking devices on the market. However, the variation in the time-out values of different types or differently configured networking devices may be substantial. Thus, when certain networking devices are utilized, there may be a large discrepancy between their individual time-out value and the lowest common denominator fixed keep-alive interval. This discrepancy may significantly impact the battery life of the client, due to the frequent and superfluous packets sent to and from the networking device. A significant amount of network traffic may also be generated when a fixed keep-alive interval is applied to a large number of clients, increasing network operating costs. Thus, a fixed keep-alive interval may have a negative impact on the computing system as a whole.
To decrease power consumption and increase networking efficiency within such a system the keep-alive interval may be increased to fit with individual time-out characteristics of different devices. One technique which may be used to increase the keep-alive interval involves establishing a connection between a client and a server via a networking device such as a NAT device, firewall, load balancer etc., and incrementally increasing the keep-alive interval until the networking device times out and drops the connection. Subsequent to the time-out, a preceding keep-alive interval which has not failed is used by the client, in an attempt to maintain a persistent connection and over time the process repeats itself with new attempts to increase the keep-alive interval.
However, using the longest keep-alive interval that has not failed in a test may result in inefficiencies and poor user experience since routine network failure may be incorrectly attributed to time-outs, and repeating the test periodically means a periodic break in the connection would be noticeable to the user. This may lead to periods of unneeded network traffic between the client and server, resulting in a poor user experience, poor battery performance, etc. These problems may be multiplied across thousands of users in the user base for a service provider to mobile clients.